package hhm.activeMQ.idontknow;

import hhm.activeMQ.idontknow.mq.MqClient;

import javax.jms.JMSException;

import org.springframework.beans.factory.annotation.Autowired;

public class ReceiverHandle implements Runnable {

	@Autowired
	private MqClient mqClient;
	@Autowired
	private ReceiverHandleImpl receiverHandleImpl;

	@Override
	public void run() {
		try {
//			mqClient.getProducer().close();
			mqClient.getConsumer().setMessageListener(receiverHandleImpl);
			mqClient.start();
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

}
